package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementBusiSrtpProtectMapper;
import com.ruoyi.net.domain.ElementBusiSrtpProtect;
import com.ruoyi.net.service.IElementBusiSrtpProtectService;

/**
 * 网元-业务-srtp-保护属性Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class ElementBusiSrtpProtectServiceImpl implements IElementBusiSrtpProtectService 
{
    @Autowired
    private ElementBusiSrtpProtectMapper elementBusiSrtpProtectMapper;

    /**
     * 查询网元-业务-srtp-保护属性
     * 
     * @param id 网元-业务-srtp-保护属性主键
     * @return 网元-业务-srtp-保护属性
     */
    @Override
    public ElementBusiSrtpProtect selectElementBusiSrtpProtectById(String id)
    {
        return elementBusiSrtpProtectMapper.selectElementBusiSrtpProtectById(id);
    }

    /**
     * 查询网元-业务-srtp-保护属性列表
     * 
     * @param elementBusiSrtpProtect 网元-业务-srtp-保护属性
     * @return 网元-业务-srtp-保护属性
     */
    @Override
    public List<ElementBusiSrtpProtect> selectElementBusiSrtpProtectList(ElementBusiSrtpProtect elementBusiSrtpProtect)
    {
        return elementBusiSrtpProtectMapper.selectElementBusiSrtpProtectList(elementBusiSrtpProtect);
    }

    /**
     * 新增网元-业务-srtp-保护属性
     * 
     * @param elementBusiSrtpProtect 网元-业务-srtp-保护属性
     * @return 结果
     */
    @Override
    public int insertElementBusiSrtpProtect(ElementBusiSrtpProtect elementBusiSrtpProtect)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiSrtpProtect.getId())) {
            elementBusiSrtpProtect.setId(uuid);
        }
        elementBusiSrtpProtect.setCreateBy(SecurityUtils.getUsername());
        elementBusiSrtpProtect.setCreateTime(DateUtils.getNowDate());
        elementBusiSrtpProtect.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpProtect.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpProtectMapper.insertElementBusiSrtpProtect(elementBusiSrtpProtect);
    }

    /**
     * 修改网元-业务-srtp-保护属性
     * 
     * @param elementBusiSrtpProtect 网元-业务-srtp-保护属性
     * @return 结果
     */
    @Override
    public int updateElementBusiSrtpProtect(ElementBusiSrtpProtect elementBusiSrtpProtect)
    {
        elementBusiSrtpProtect.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpProtect.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpProtectMapper.updateElementBusiSrtpProtect(elementBusiSrtpProtect);
    }

    /**
     * 批量删除网元-业务-srtp-保护属性
     * 
     * @param ids 需要删除的网元-业务-srtp-保护属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpProtectByIds(String[] ids)
    {
        return elementBusiSrtpProtectMapper.deleteElementBusiSrtpProtectByIds(ids);
    }

    /**
     * 删除网元-业务-srtp-保护属性信息
     * 
     * @param id 网元-业务-srtp-保护属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpProtectById(String id)
    {
        return elementBusiSrtpProtectMapper.deleteElementBusiSrtpProtectById(id);
    }
}
